package com.gelpag.base;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import tools.utils.IdWorker;

//springboot的启动类，必须要添加。以后所有的内容必须在当前包下面，要不spring无法扫描到，不会加载到容器中
@SpringBootApplication
//注册为eureka客户端
@EnableEurekaClient
//feign相关配置，先发现服务，然后以feign的形式发现服务
@EnableDiscoveryClient
@EnableFeignClients
//设置mybatis扫描的路径
@MapperScan("com.gelpag.base.business")
public class BaseApplication {

    public static void main(String[] args) {
        SpringApplication.run(BaseApplication.class, args);
    }

    /**
     * 将uuid生成器加入到容器中
     * @return
     */
    @Bean
    IdWorker getIdWorker() {
        return new IdWorker();
    }

}
